﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for AnalysAndInsert
/// </summary>
public class AnalysisAndInsert
{
    string _tblName;
	public AnalysisAndInsert(string _tblName)
	{
        this._tblName = _tblName;
        new RadioButtonHandler(Variables.checkedRadioButtonList); //Đưa các radibutton được check vào list
        new TextBoxHandler(Variables.TextBoxList); // Đưa các textbox có giá trị text vào list

        Variables.questionListSymbol = new List<QuestionObject>(); // khởi tạo lại QuestionObject list
        new ContentHandler(new TextBox());
        new ContentHandler(new RadioButton());

       
        DatabaseHandler db = new DatabaseHandler();
        db.connect();
        foreach (var question in Variables.questionListSymbol)
        {
            db.CapNhatChiSo(Variables.IDDN, _tblName, question.getColumnName(), question.getValue());
        }
        db.close();

        Variables.TextBoxList.Clear();
        Variables.checkedRadioButtonList.Clear();
        Variables.questionListSymbol.Clear();
	}


}